Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: {},
    teamersPageDesign: [
      {
        id: 0,
        isActive: false,
        brief:'19级软工 翟彬州',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 1,
        isActive: false,
        brief:'19级软工 王晓东',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 2,
        isActive: false,
        brief:'19级软工 陈昱均',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 3,
        isActive: false,
        brief:'19级软工 贾晋',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 4,
        isActive: false,
        brief:'19级软工 徐文哲',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      }
    ],
    teamersDataProcess: [
      {
        id: 0,
        isActive: false,
        brief:'19级软工 翟彬州',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 1,
        isActive: false,
        brief:'19级软工 曹天华',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 2,
        isActive: false,
        brief:'19级软工 汤近涛',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      }
    ], 
    teamersAnnounce: [
      {
        id: 0,
        isActive: false,
        brief:'19级软工 翟彬州',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 1,
        isActive: false,
        brief:'19级软工 陈昱均',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      },
      {
        id: 2,
        isActive: false,
        brief:'19级软工 罗潭',
        detail:'这是人物详细介绍，巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉'
      }
    ],
    unfoldClicked1: false,
    unfoldClicked2: false,
    unfoldClicked3: false,
    text_pageDesign: "展开 +",
    text_dataProcess: "展开 +",
    text_announce: "展开 +",
  },
  handleUnfold1: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersPageDesign } = this.data;
    teamersPageDesign.forEach((v, i) => i === index ? v.isActive = true : null);
    this.setData({
      teamersPageDesign
    })
  },
  handleUnfold2: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersDataProcess } = this.data;
    teamersDataProcess.forEach((v, i) => i === index ? v.isActive = true : null);
    this.setData({
      teamersDataProcess
    })
  },
  handleUnfold3: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersAnnounce } = this.data;
    teamersAnnounce.forEach((v, i) => i === index ? v.isActive = true : null);
    this.setData({
      teamersAnnounce
    })
  },
  handleFold1: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersPageDesign } = this.data;
    teamersPageDesign.forEach((v, i) => i === index ? v.isActive = false : null);
    this.setData({
      teamersPageDesign
    })
  },
  handleFold2: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersDataProcess } = this.data;
    teamersDataProcess.forEach((v, i) => i === index ? v.isActive = false : null);
    this.setData({
      teamersDataProcess
    })
  },
  handleFold3: function (e) {
    const { index } = e.currentTarget.dataset;    //获取索引
    let { teamersAnnounce } = this.data;
    teamersAnnounce.forEach((v, i) => i === index ? v.isActive = false : null);
    this.setData({
      teamersAnnounce
    })
  },
  handleHeadTap: function () {
    console.log(1)
    // wx.navigateTo({
    //   url: '../personal/personal?userId'
    // })
  },
  handleClick: function (e) {
    switch (e.currentTarget.id) {
      case 'pageDesign':
        if (this.data.text_pageDesign == "展开 +") {
          this.setData({
            unfoldClicked1: true,
            text_pageDesign: "收起 -"
          })
        } else if (this.data.text_pageDesign == "收起 -") {
          this.setData({
            unfoldClicked1: false,
            text_pageDesign: "展开 +"
          })
        };
        break;
      case 'dataProcess':
        if (this.data.text_dataProcess == "展开 +") {
          this.setData({
            unfoldClicked2: true,
            text_dataProcess: "收起 -"
          })
        } else if (this.data.text_dataProcess == "收起 -") {
          this.setData({
            unfoldClicked2: false,
            text_dataProcess: "展开 +"
          })
        };
        break;
      case 'announce':
        if (this.data.text_announce == "展开 +") {
          this.setData({
            unfoldClicked3: true,
            text_announce: "收起 -"
          })
        } else if (this.data.text_announce == "收起 -") {
          this.setData({
            unfoldClicked3: false,
            text_announce: "展开 +"
          })
        };
        break;
    }
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setUser();
  },

  setUser() {
    const userInfo = wx.getStorageSync('userInfo')
    if (userInfo) {
      this.setData({
        userInfo
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})